import { Todo, TodoAction, TodoType } from '..'
// 根据 id 删除数据
export const delById = (id: number): TodoAction => ({ type: 'delById', payload: id })
// 根据 id 更新完成状态
export const changeDoneById = (id: number): TodoAction => ({ type: 'changeDoneById', payload: id })
// 删除已完成任务
export const clearAllDone = (): TodoAction => ({ type: 'clearAllDone' })
// 高亮切换效果
export const changeType = (type: TodoType): TodoAction => ({ type: 'changeType', payload: type })
// 新增待办任务
export const addTodo = (todo: Todo): TodoAction => ({ type: 'addTodo', payload: todo })
// 切换全选
export const changeAll = (checked: boolean): TodoAction => ({ type: 'changeAll', payload: checked })
